import { useRef, forwardRef, useImperativeHandle } from "react";
import {
  ModalTrigger,
  Modal,
  ModalBody,
  ModalContent,
} from "./ui/animated-modal";

const ParamsModal = forwardRef(({}, ref) => {
  const trigger_ref = useRef();
  useImperativeHandle(ref, () => ({
    open: () => {
      console.log("trigger invoking...");

      trigger_ref.current.open();
    },
    close: () => {
      trigger_ref.current.close();
    },
  }));
  return (
    <>
      <div className="dark">
        <Modal>
          <ModalTrigger ref={trigger_ref}></ModalTrigger>
          <ModalBody>
            <ModalContent>
              <div>this is</div>
            </ModalContent>
          </ModalBody>
        </Modal>
      </div>
    </>
  );
});

export default ParamsModal;
